////
////  ViewController.m
////  CollTest
////
////  Created by codew on 8/31/21.
////
//
//#import "ViewController.h"
//#import "Masonry.h"
//
//
//// 屏幕适配
//#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
//#define ScreenWidth  [[UIScreen mainScreen] bounds].size.width
//
//#define CPSCRGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
//#define kCPSCRandomColor CPSCRGBA(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255),1)
//#define DggWEAKSELF(weakSelf) __weak __typeof(&*self)weakSelf = self
//
//
//
//@interface ViewController ()<UICollectionViewDelegate, UICollectionViewDataSource>
//@property (strong, nonatomic) UICollectionView * collectionView;
//@property (strong, nonatomic) UICollectionViewFlowLayout *collectionLayout;
//
//
//
//@end
//
//
//
//@implementation ViewController
//
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//    
//    
//    [self setUpMainUI];
//}
//
//- (void)setUpMainUI
//{
//    [self.view addSubview:self.collectionView];
//    [self makeContraints];
//    [self debugUI];
//}
//
//- (void)makeContraints {
//    
//    [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.edges.mas_equalTo(UIEdgeInsetsZero);
//    }];
//    
//}
//
//- (void)debugUI
//{
//    self.view.backgroundColor = [UIColor redColor];
//    self.collectionView.backgroundColor = UIColor.yellowColor;
//}
//
//#pragma mark - UICollectionViewDelegate
//
//- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
//{
//
//}
//
//#pragma mark - UICollectionViewDataSource
//- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
//{
//    
//    return 20;
//}
//
//
//- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
//{
//    
////    CPSCKnowVideoContentModel *model = self.viewModel.videoList[indexPath.item];
//    UICollectionViewCell *cell =  [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([UICollectionViewCell class]) forIndexPath:indexPath];
//    
//    cell.backgroundColor = kCPSCRandomColor;
////    cell.model = model;
//    return cell;
//}
//
//
//#pragma mark - Getter Setter
//
//
//
//#pragma mark - Getter Setter
//
//- (UICollectionView *)collectionView {
//    if (!_collectionView) {
//        
//        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
//        
//        CGFloat margin = 5;
//        CGFloat column = 2;
//        CGFloat sectionInsetLR = margin * 2;
//        CGFloat rowAllMargin = margin * (column -1);
//        CGFloat cellWidth = (ScreenWidth - rowAllMargin - sectionInsetLR) / column;
//        
//        
//        CGFloat cellHeight = 320;
//        flowLayout.itemSize = CGSizeMake(cellWidth, cellHeight);
//        flowLayout.minimumInteritemSpacing = margin;
//        flowLayout.minimumLineSpacing = margin;
////        UIEdgeInsetsMake(<#CGFloat top#>, <#CGFloat left#>, <#CGFloat bottom#>, <#CGFloat right#>)
//        flowLayout.sectionInset = UIEdgeInsetsMake(0, margin, 0, margin);
//        
//                        
//        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:flowLayout];
//        _collectionView.backgroundColor = [UIColor whiteColor];
//        _collectionView.dataSource = self;
//        _collectionView.delegate = self;
//        _collectionView.showsHorizontalScrollIndicator = NO;
//        _collectionView.showsVerticalScrollIndicator = NO;
//        [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([UICollectionViewCell class])];
//    }
//    
//    return _collectionView;
//}
//
//
//@end
//
